<div class="wrap">
    <div id="icon-upload" class="icon32"><br></div>
    <h2>Přehrávače <a href="{link target='self:addPlayer'}" class="add-new-h2">Přidat přehrávač</a> </h2>
    {include file="messages.tpl"} 
    <form id="posts-filter" action="{link target='self:defaultBulkAction'}" method="post">
        <input name="token" type="hidden" value="{wp_nonce target='self:defaultBulkAction'}" />
        <div class="tablenav top">
            <div class="alignleft actions">
                <select name="action1">
                    <option value="-1" selected="selected">Hromadné úpravy</option>
                    <option value="remove">Odstranit</option>
                </select>
                <input type="submit" name="" id="doaction" class="button-secondary action" value="Použít">
            </div>
            {include file="pager.tpl" position='top' pager=$pager page='defaultAction' append='orderBy,order'}
            <br class="clear">
        </div>
        <table class="wp-list-table widefat fixed pages" cellspacing="0">
            <thead>
                <tr>
                    <th scope="col" id="cb" class="manage-column column-cb check-column" style="">
                        <input type="checkbox">
                    </th>                    
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='name'}" style="width:220px">
                        <a href="{sortlink orderBy='name' append='paged'}"><span>Název
                            </span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='clientKey'}" style="">
                        <a href="{sortlink orderBy='clientKey' append='paged'}"><span>Klíč</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='status'}">
                        <a href="{sortlink orderBy='status' append='paged'}"><span>Stav</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='lastSeen'}">
                        <a href="{sortlink orderBy='lastSeen' append='paged'}"><span>Zahlédnut</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='version'}">
                        <a href="{sortlink orderBy='version' append='paged'}"><span>Verze</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title" style="width:260px;">
                      
                    </th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <th scope="col" id="cb" class="manage-column column-cb check-column" style="">
                        <input type="checkbox">
                    </th>                    
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='name'}" style="">
                        <a href="{sortlink orderBy='name' append='paged'}"><span>Název
                            </span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='clientKey'}" style="">
                        <a href="{sortlink orderBy='clientKey' append='paged'}"><span>Klíč</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='status'}">
                        <a href="{sortlink orderBy='status' append='paged'}"><span>Stav</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='lastSeen'}">
                        <a href="{sortlink orderBy='lastSeen' append='paged'}"><span>Zahlédnut</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='version'}">
                        <a href="{sortlink orderBy='version' append='paged'}"><span>Verze</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title">
                      
                    </th>
                </tr> 
            </tfoot>
            <tbody id="the-list">
                {foreach $players as $player} 
                <tr class="{cycle values='alternate,'}" valign="top">
                    <th scope="row" class="check-column"><input type="checkbox" name="post[]" value="{$player.playerId}"></th>
                    <td class="post-title page-title column-title">
                        <strong>
                            <a class="row-title" href="{link target='self:editPlayer' playerId=$player.playerId}" title="Upravit „{$player.name|escape}“">{$player.name|escape}</a>
                        </strong>
                        <div class="row-actions">
                            <span class="edit"><a href="{link target='self:editPlayer' playerId=$player.playerId}" title="Upravit tuto položku">Upravit</a> | </span>
                            <span class="edit"><a href="{link target='self:editPlayer' playerId=$player.playerId}" title="Upravit tuto položku">Monitorování</a> | </span>
                            <span class="trash"><a class="submitdelete" title="Přesunout tuto položku do koše" href="{link target='self:removePlayer' playerId=$player.playerId token='true'}">Odstranit</a></span>
                        </div>
                    </td>
                    <td class="post-title page-title column-title">
                       {$player.clientKey|escape}
                    </td> 
                    <td class="post-title page-title column-title">
                        {if $player.status == 1}<span class="online">online</span>{else}<span class="offline">offline</span>{/if}
                    </td>
                    <td class="post-title page-title column-title">
                       {$player.lastSeen|escape}
                    </td>
                    <td class="post-title page-title column-title">
                       {$player.version|escape}
                    </td>
                    <td class="post-title page-title column-title">
                        <a href="{link target='self:sendCommand' cmd='restart' playerId=$player.playerId}" class="ctrl icoRestart">Restart</a>
                        <a href="{link target='self:sendCommand' cmd='fullRestart' playerId=$player.playerId}" class="ctrl icoFullRestart">Tvrdý restart</a>
                        <a href="{link target='self:sendCommand' cmd='powerOff' playerId=$player.playerId}" class="ctrl icoPowerOff">Vypnout</a>
                    </td>
                </tr>
                {foreachelse}
                <tr>
                    <td colspan="4">Nebyly nalezeny žádné položky.</td>
                </tr>
                {/foreach}
            </tbody>
        </table>
        <div class="tablenav bottom">
            <div class="alignleft actions">
                <select name="action2">
                    <option value="-1" selected="selected">Hromadné úpravy</option>
                    <option value="remove">Odstranit</option>
                </select>
                <input type="submit" name="" class="button-secondary action" value="Použít">
            </div>
            <div class="alignleft actions">
            </div>
            {include file="pager.tpl" pager=$pager page='defaultAction' append='orderBy,order'}
            <br class="clear">
        </div>
    </form>
</div>
